#include <iostream>
#include <string>
using namespace std;

void _get_line()
{
    string word;
    cout << "Enter words (q to quit): ";
    while (getline(cin, word))
    {
        if (word == "q")
            break;
        cout << word << endl;
    }
}

void _bound()
{
    string s;
    cout << s.length() << endl;
    cout << s[1] << endl; // 居然没报错
}

void _length()
{
    char str[2] = ""; // "ab"(len 3) is wrong
}

void _cstr()
{
    const char ca[] = {'a', 'b', 'c'}; // c-string but should not use, good-one is {'a','b','c', '\0'} or string str = "abc"
    const char *pc = ca;
    while (*pc)
    {
        cout << *pc << endl;
        pc++;
    }
}
int main()
{
    _cstr();
    _get_line();
    _bound();
    return 0;
}